Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoongArch64: Fix dsymv and ssymv LASX version #5070

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

xry111
Copy link
Contributor

@xry111 xry111 commented Jan 13, 2025

"fmov.d $f2, $f4" leaves all the bits higher than the 63-th bit unpredictable but it's obvious that the following code uses the value of those high bits. We actually want to replicate the lower 64 bits here, so we should use xvreplve0.d instead.

LA464 (Loongson 3[A-Z]-5000) happens to replicate them for us due to some uarch internal details so the issue was not detected, but for LA664 (Loongson 3[A-Z]-6000) and future uarch we need to do things correctly or we end up getting a lot of test failures.

Closes: https://bbs.aosc.io/t/topic/302

"fmov.d $f2, $f4" leaves all the bits higher than the 63-th bit
unpredictable but it's obvious that the following code uses the value of
those high bits.  We actually want to replicate the lower 64 bits here,
so we should use xvreplve0.d instead.

LA464 (Loongson 3[A-Z]-5000) happens to replicate them for us due to
some uarch internal details so the issue was not detected, but for LA664
(Loongson 3[A-Z]-6000) and future uarch we need to do things correctly
or we end up getting a lot of test failures.

Closes: https://bbs.aosc.io/t/topic/302
Signed-off-by: Xi Ruoyao <[email protected]>
@XiWeiGu
Copy link
Contributor

XiWeiGu commented Jan 13, 2025

Yes, I have introduced a bug. We should broadcast the accumulated result instead of simply moving it.

@martin-frbg martin-frbg added this to the 0.3.30 milestone Jan 13, 2025
@azuresky01
Copy link

I confirm that your changes do fix the problem. The compilation error disappears.

@martin-frbg
Copy link
Collaborator

Thank you for the quick fix.

@martin-frbg martin-frbg merged commit 9b98103 into OpenMathLib:develop Jan 13, 2025
80 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants